package sd.qd.xiaoming.coffeedesk.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * 表示一个文件
 */
@Entity
@XmlRootElement
public class CdFile extends BaseEntity {

	private String name;
	private String code;
	private CdDirectory directory;
	private String summary;
	private Date upTime;
	private Date editTime;
	private String type;
	private Long size;
	private Long accessCount;
	private Date lastAccessTime;

	public Long getAccessCount() {
		return this.accessCount;
	}

	public String getCode() {
		return this.code;
	}

	@ManyToOne
	public CdDirectory getDirectory() {
		return this.directory;
	}

	public Date getEditTime() {
		return this.editTime;
	}

	public Date getLastAccessTime() {
		return this.lastAccessTime;
	}

	public String getName() {
		return this.name;
	}

	public Long getSize() {
		return this.size;
	}

	public String getSummary() {
		return this.summary;
	}

	public String getType() {
		return this.type;
	}

	public Date getUpTime() {
		return this.upTime;
	}

	public void setAccessCount(final Long accessCount) {
		this.accessCount = accessCount;
	}

	public void setCode(final String code) {
		this.code = code;
	}

	public void setDirectory(final CdDirectory directory) {
		this.directory = directory;
	}

	public void setEditTime(final Date editTime) {
		this.editTime = editTime;
	}

	public void setLastAccessTime(final Date lastAccessTime) {
		this.lastAccessTime = lastAccessTime;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public void setSize(final Long size) {
		this.size = size;
	}

	public void setSummary(final String summary) {
		this.summary = summary;
	}

	public void setType(final String type) {
		this.type = type;
	}

	public void setUpTime(final Date upTime) {
		this.upTime = upTime;
	}

	@Override
	public String toString() {
		return "CdFile [name=" + this.name + ", code=" + this.code + ", directory=" + this.directory + ", summary=" + this.summary + ", upTime=" + this.upTime + ", editTime=" + this.editTime
				+ ", type=" + this.type + ", size=" + this.size + ", accessCount=" + this.accessCount + ", lastAccessTime=" + this.lastAccessTime + "]";
	}


}
